#pragma once

#include "WinBase.h"
#include "WinScopeLock.h"

class WinLock
{
public:
	typedef WinScopeLock_T<WinLock> ScopeLock;

	WinLock();
	~WinLock();

	void lock();
	void lock(long millisec);
	void unlock();

private:
	CRITICAL_SECTION m_lock;

	WinLock(const WinLock &);
	WinLock& operator = (const WinLock&);
};